using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SiKuma.ScreenSystemLibrary
{
    public abstract class LogoScreen : IntroScreen
    {
        private Color fadeColor;
        private float fadePercent;
        
        public Texture2D Texture
        {
            get;
            set;
        }
        
        protected LogoScreen()
        {
        }
        
        protected LogoScreen(Color fadeColor, float fadePercent)
        {
            this.fadeColor = fadeColor;
            this.fadePercent = fadePercent;
        }
        
        public override void InitializeScreen()
        {
            base.TransitionOnTime = (base.TransitionOffTime = TimeSpan.FromSeconds(2.5));
            base.EnableFade(this.fadeColor, this.fadePercent);
        }
        
        public abstract override void LoadContent();
        
        protected override void DrawScreen(GameTime gameTime)
        {
            SpriteBatch spriteBatch = base.ScreenSystem.SpriteBatch;
            Viewport viewport = base.ScreenSystem.Game.GraphicsDevice.Viewport;
            Vector2 position = new Vector2((float)(viewport.Width / 2 - this.Texture.Width / 2), (float)(viewport.Height / 2 - this.Texture.Height / 2));
            spriteBatch.Draw(this.Texture, position, Color.White * this.ScreenAlpha);
        }
    }
}
